<template>
	<view>
		<update v-if="Object.keys(update).length>0" :updateType="update.updateType" :updateTitle="update.updateTitle"
			:updateDes="update.updateDes" :updateUrl="update.updateUrl" :isForcedUpdate="update.isForcedUpdate"
			:isUpdateApp="update.isUpdateApp"></update>
		<home v-if="PageCur=='home'"></home>
		<!-- <workbench v-if="PageCur=='workbench'"></workbench> -->
		<personage v-if="PageCur=='personage'"></personage>
		<view class="cu-bar tabbar bg-white shadow foot">
			<view :class="PageCur=='home'?'action text-blue':'action text-gray'" @click="NavChange"
				data-cur="home">
				<view class='cuIcon-comment'></view>首页
			</view>
			<!-- <view :class="PageCur=='workbench'?'action text-blue':'action text-gray'" @click="NavChange"
				data-cur="workbench">
				<view class='cuIcon-peoplelist'></view>工作台
			</view> -->
			<view :class="PageCur=='personage'?'action text-blue':'action text-gray'" @click="NavChange"
				data-cur="personage">
				<view class='cuIcon-people'></view>我的
			</view>
		</view>
	</view>
</template>

<script>
	import {
		mapGetters,
		mapActions
	} from "vuex"
	import update from '@/components/maozai-update/updateAppTip.vue'
	export default {
		components: {
			update
		},
		data() {
			return {
				PageCur: 'home',
			}
		},
		computed: {
			...mapGetters(['isLogin', 'update'])
		},
		onLoad() {
			let that = this;
			setTimeout(function() {
				that.PageCur = 'home';
			}, 1);
		},
		methods: {
			...mapActions(['loginAction', 'userInfoAction', 'isLoginAction', 'setUpdate']),
			NavChange: function(e) {
				this.PageCur = e.currentTarget.dataset.cur
			},
		}
	}
</script>

<style>

</style>
